package Level02;

import java.util.ArrayList;
import java.util.HashMap;

public class Eight {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("abc");
        arrayList.add("abc");
        HashMap<Character, Integer> hashMap = new HashMap<>();
        for (String str : arrayList) {
            char[] chars = str.toCharArray();
            for (char aChar : chars) {
                hashMap.put(aChar,hashMap.getOrDefault(aChar,0)+1);
            }
        }
        System.out.println(hashMap);
    }
}
